package com.briup.smartcity_group1.utils.result;

/**
 * 使用枚举类表示响应信息常用字符串和状态码
 * @Author lining
 * @Date 2022/12/26
 */
public enum ResultCode {

    // 通用结果码
    SUCCESS(1,"操作成功"),
    ERROR(2,"操作失败"),
    INTERNAL_ERROR(3, "系统内部错误，请联系管理员"),

    USER_LOGIN_PASSWD_ERROR(10001,"密码错误"),
    USER_NOT_FOUND(10002, "用户不存在"),
    USER_LOGIN_LOCKED(10003, "用户被锁定，请联系账户管理员"),

    USER_REGISTER_USERNAME_PARAM_ERROR(10004, "用户名格式错误，请填写正确的格式"),
    USER_REGISTER_EMAIL_PARAM_ERROR(10004, "邮箱格式错误，请填写正确的格式"),
    USER_REGISTER_TELEPHONE_PARAM_ERROR(10004, "手机号格式错误，请填写正确的格式"),

    USER_REGISTER_DUPLICATE_USERNAME(10005, "用户名已被注册"),
    USER_REGISTER_DUPLICATE_EMAIL(10006,"邮箱已被注册"),
    USER_REGISTER_DUPLICATE_TELEPHONE(10007,"手机号已被注册"),

    USER_LOGOUT_HAVE_LOGGED_OUT(10008, "已登出或者登录信息已失效"),
    USER_INVALID_TOKEN(10009, "无效的登录凭证"),
    USER_UPDATE_PERMISSION_DINED(10010, "没有更新的权限"),


    ARTICLE_NOT_FOUND(30001, "咨询不存在"),
    ARTICLE_UNEXPECTED_STATUS(30002, "期望之外的状态"),

    CAROUSEL_DELETE_LIMIT_ENABLED(20001,"不可删除启用状态的轮播图"),
    CAROUSEL_DELETE_LIMIT_MIN(20002,"不可删除全部轮播图,至少需要保留一张轮播图"),
    CAROUSEL_DUPLICATE_URL(20003,"轮播图地址重复"),
//    CAROUSEL_AUTO_ENABLED(20004,"至少开启一张轮播图,当前项已强制开启"),

    BASE_CONFIG_STATUS_LIMIT_MIN(40001,"不可禁用所有配置信息,至少需要开启一则," +
            "请通过开启另一则 配置禁用当前项"),
    BASE_CONFIG_DELETE_LIMIT_MIN(40002,"不可删除,至少需要保留一则配置信息"),
    BASE_CONFIG_DELETE_LIMIT_ENABLED(40003,"不可删除启用状态的配置信息,请禁用后再删除"),
    BASE_CONFIG_NOT_FOUND(40004,"待处理信息不存在"),

    CATEGORY_NOT_FOUND(60001,"待处理信息不存在"),
    CATEGORY_SAVE_INVALID_ORDER(60002,"序号不能为0或负值"),
    CATEGORY_NOT_FOUND_BATCH_PARTLY(60003,"待批处理数据中有部分数据不存在"),
    CATEGORY_NOT_FOUND_BATCH_ALL(60004,"待批处理数据全不存在"),

    COMMENT_NOT_FOUND(80001,"待处理信息不存在"),
    COMMENT_UNEXPECTED_STATUS(80002,"期望之外的状态"),
    COMMENT_NOT_FOUND_BATCH_PARTLY(80003, "待批处理数据中有部分数据不存在"),
    COMMENT_NOT_FOUND_BATCH_ALL(80004,"待批处理数据全不存在"),
    //数据错误
    DATA_ERROR(20001,"数据错误");

    //定义一个枚举对象表示具体的一个错误信息 用户不存在


    private Integer code;
    private String msg;

    ResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}